package com.ace.user.common.bean;

import com.ace.user.common.constant.Group;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;

/**
 * 集合数据载体
 * @Author yudong
 * @Date 2018年07月19日 下午5:20
 */
@Data
@Accessors(chain = true)
public class ObjectListDTO<O> implements Serializable {

    private static final long serialVersionUID = -4196778987612354007L;


    /**
     * 集合数据
     */
    @Valid
    @Size(min=1,message = "{objectListDTO.list.size}",groups = {Group.Add.class})
    @NotNull(message = "{objectListDTO.list}",groups = {Group.Add.class})
    private List<O> list;

    /**
     * 数量
     */
    @NotNull(message = "{objectListDTO.size}",groups = {Group.Add.class})
    @Min(value = 1,message = "{objectListDTO.size.max}",groups = {Group.Add.class})
    private int size;


}
